from crypto_kit.AES import AES as aes
from crypto_kit.SM4 import SM4 as sm4
from attacker import *

get_real_midvalue={
    "AES":aes.real_midvalue,
    "SM4":sm4.real_midvalue
}

get_guess_midvalue={
    "AES":aes.guess_midvalue,
    "SM4":sm4.guess_midvalue
}

get_round_key={
    "AES":aes.round_key,
    "SM4":sm4.round_key
}

get_plaintext_bytes={
    "AES":aes.bytes_num('plaintext_bytes'),
    "SM4":16,
    'DES':8
}

get_ciphertext_bytes={
    "AES":aes.bytes_num('ciphertext_bytes'),
    "SM4":16,
    'DES':8
}

get_mkey_bytes={
    "AES":aes.bytes_num('mkey_bytes'), #m就是main
    "SM4":16,
    'DES':8
}

func_profile={
    "DPA":None,
    "CPA":None,
    "TA":TA.profile,
    "DLSCA":DLSCA.profile
}

func_attack={
    "DPA":DPA.attack,
    "CPA":CPA.attack,
    "TA":TA.attack,
    "DLSCA":DLSCA.attack
}

func_guess_key={
    "DPA": DPA.get_guess_key,
    "CPA": CPA.get_guess_key,
    "TA": TA.get_guess_key,
    "DLSCA": DLSCA.get_guess_key
}

func_rank={
    "DPA": DPA.get_rank,
    "CPA": CPA.get_rank,
    "TA": TA.get_rank,
    "DLSCA": DLSCA.get_rank
}